<style>
    .fieldlist dd ins {
        width: 27% !important;
    }
    .fieldlist dd input:first-child {
        width: 100% !important;
    }
    .form-inline .selectpicker{
        width: 100% !important;
        left: 0 !important;
    }
</style>


<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <input id="c-key" type="hidden" data-rule="required"  class="form-control" name="row[key]" value="{$key}" />
    <div class=" form-group">
        <label for="c-describe" class="control-label col-xs-12 col-sm-2">{:__('短息模板名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-describe" data-rule="required" type="text" class="form-control" name="row[describe]" value="" />
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('模板编号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-tpl_id" data-rule="required" class="form-control" name="row[values][tpl_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('跟进类型')}:</label>
        <div class="col-xs-12 col-sm-8">

            {:build_select('row[values][record_type]', $recordTypeList,0, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
            <span class="text-gray">{:__("发送邮件会自动添加一条跟进记录，所以要选择跟进类型")}</span>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('参数类型')}:</label>
        <div class="col-xs-12 col-sm-8">

            {:build_select('row[values][param_type]', $modelList,'customer',
            ['class'=>'form-control selectpicker', 'data-rule'=>'required','id'=>'c-param_type'])}
            <span class="text-gray">{:__("不能再修改")}</span>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('模板参数')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-template="content-tpl" data-name="row[content]" data-tpl='{$template_data}'>
                <dd>
                    <ins>{:__('参数')}</ins>
                    <ins>{:__('值')}</ins>
                    <ins>{:__('默认值')}</ins>
                </dd>
                <dd>
                    <a href="javascript:;" class="btn btn-sm btn-success btn-append">
                        <i class="fa fa-plus"></i> {:__('Append')}
                    </a>
                </dd>
                <!--请注意 dd和textarea间不能存在其它任何元素，实际开发中textarea应该添加个hidden进行隐藏-->
                <textarea name="row[content]" data-rule="required" class="form-control hide" cols="30" rows="5"></textarea>
            </dl>

            <script id="content-tpl" type="text/html">
                <dd class="form-inline">
                    <ins><input type="text" name="<%=name%>[<%=index%>][value]" class="form-control" value="<%=row.value%>" placeholder="内容"/></ins>
                    <ins>
                        <select class="form-control selectpicker" name="<%=name%>[<%=index%>][key]">
                            <% for(let i in data.tpl){  %>
                            <option value="<%= i %>"><%= data.tpl[i] %></option>
                            <% } %>
                        </select>
                    </ins>
                    <ins><input type="text" name="<%=name%>[<%=index%>][def_val]" class="form-control" value="<%=row.def_val%>" placeholder="默认值"/></ins>
                    <!--下面的两个按钮务必保留-->
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
            </script>

            <!-- <input id="c-content" class="form-control" name="row[content]" type="text"> -->
        </div>
    </div>
    <div class=" form-group">
        <label for="c-tpl_content" class="control-label col-xs-12 col-sm-2">{:__('短息模版内容')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-tpl_content" class="form-control " name="row[values][tpl_content]" ></textarea>
            <span class="help-block">*用于预览短息.支持自定义变量，如客户名称：{literal}{:name}{/literal}</span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('状态')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[status]', [1=>'正常','0'=>'禁用'], 1, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
            <span class="text-gray"></span>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>



</form>







